package com.lzs.bootsafety.common.util;

import com.lzs.bootsafety.business.sys.entity.SysUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import java.util.Date;

/**
 * @Author LiuZhanShi
 * @Date 2020/7/30 16:36
 * @Version 1.0
 */

public class ShiroUtil {
    public static SysUser getUser() {
        return (SysUser) SecurityUtils.getSubject().getPrincipal();
    }
    public static Long getUserId() {
        return getUser().getUserId();
    }
    public static String getUserName() {
        return getUser().getUsername();
    }
    public static Subject getSubject(){
        return SecurityUtils.getSubject();
    }
}
